package leveldesigner.map;

import java.io.Serializable;
import java.util.ArrayList;

import leveldesigner.util.Matrix;

public class Map implements Serializable{
	private static final long serialVersionUID = -2787018357426189489L;
	private ArrayList <Layer>layers;
	private String name;
	private int width;
	private int height;
	
	public Map(int width, int height, String name){
		layers = new ArrayList<Layer>();
		this.width = width;
		this.height = height;
		this.name = name;
	}
	
	public void setLayers(ArrayList <Layer> layers) {
		this.layers = layers;
	}

	public ArrayList <Layer> getLayers() {
		return layers;
	}

	public void setSize(int width, int height){
		this.setWidth(width);
		this.setHeight(height);
	}
	public void setWidth(int width) {
		this.width = width;
		for(Layer layer: layers){
			Matrix<MapTile> matrix = layer.getMatrix();
			matrix.setWidth(width);
		}
	}

	public int getWidth() {
		return width;
	}

	public void setHeight(int height) {
		this.height = height;
		for(Layer layer: layers){
			Matrix<MapTile> matrix = layer.getMatrix();
			matrix.setHeight(height);
		}
	}

	public int getHeight() {
		return height;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
